import {reactive} from "vue";

const state = reactive({
    homeworks: [], // 存储通知数据的数组
});
const mutations = {
    addHomework(state, newHomework) {
        console.log('dusaduasd',state.homeworks)
        state.homeworks.push(newHomework);
        console.log('newhomeword',newHomework);
    },
    deleteHomework(state, index) {
        state.homeworks.splice(index, 1);
    }
};
const getters = {
    allHomeworks: (state) => state.homeworks
};

export default {
    namespaced: true,
    state,
    mutations,
    getters,
};